import {
  post,
  get,
  put,
  dalete,
  postJosn,
  putone,
  patch,
  patchJson,
  daleteJson,
} from '../utils/request';

//查询商品分类
export function getGoodsTypeList(data) {
  return post('/api/goods-service/v1/goods/getGoodstypeList', data);
}

//查询商品
export function querygoodsByName(data) {
  return post('/api/goods-service/v1/membergoods/querygoodsByName', data);
}

//查询商品分类
export function queryGoodsCategorys(data) {
  return post('/api/goods-service/v1/goods/getGoodstypeList', data);
}

//删除 商品分类
export function deleteGoodsCategory(data) {
  return dalete(
    '/api/goods-service/v1/goodsCategory/deleteGoodsCategory',
    data
  );
}

//新增商品分类
export function createGoodsCategory(data) {
  return post('/api/goods-service/v1/goodsCategory/createGoodsCategory', data);
}
//编辑商品分类
export function updateGoodsCategory(data) {
  return post('/api/goods-service/v1/goodsCategory/updateGoodsCategory', data);
}

//商品列表  start
//查询单位
export function getProductUnitList(data) {
  return post('/api/goods-service/v1/GoodsUnit/queryGoodsUnit', data);
}

//查询供应商
export function getSupplyList(data) {
  return post('/api/goods-service/v1/goods/queryVentors', data);
}

//查询品牌
export function queryGoodsBrands(data) {
  return post('/api/goods-service/v1/goods/queryGoodsBrands', data);
}

//查询总计商品
export function getProductTotalInfo(data) {
  return post('/api/goods-service/v1/goods/queryThreeTotal', data);
  //return post('http://127.0.0.1:18080/api/goods-service/v1/goods/queryThreeTotal', data);
}

//查询商品
export function getProductList(data) {
  return post('/api/goods-service/v1/goods/queryGoodsInfoList', data);
  // return post('http://127.0.0.1:18080/api/goods-service/v1/goods/queryGoodsInfoList', data);
}

//新增商品
export function createGoodsInfo(data) {
  return post('/api/goods-service/v1/goods/createGoodsInfo', data);
}
//编辑商品
export function modifyGoodsInfo(data) {
  return putone('/api/goods-service/v1/goods/modifyGoodsInfo', data);
}
//删除 商品
export function deleteGoodsInfo(data) {
  return dalete('/api/goods-service/v1/goods/delGoodsId?goodsId=' + data);
}

//批量新增
export function batchRenewWarzoneGoods(data) {
  return post(
    '/api/goods-service/v1/goods/batchRenewWarzoneGoods?orgSeq=' + data.orgSeq,
    data.para
  );
}
//批量删除大区商品
export function batchDelWarzoneGoods(data) {
  return post('/api/goods-service/v1/goods/batchDelWarzoneGoods', data);
}

//大区商品
export function queryWarzoneGoodsList(data) {
  return post('/api/goods-service/v1/goods/queryWarzoneGoodsList', data);
}
//下拉大区
export function getWarzoneGoodsList(data) {
  return post('/api/goods-service/v1/goods/getWarzoneGoodsList', data);
}

//查询商品价格
export function queryGoodsPrices(data) {
  return post('/api/goods-service/v1/goodsPrice/queryGoodsPricesPage', data);
}
//编辑商品价格
export function modifyGoodsPrice(data) {
  return patchJson(
    '/api/goods-service/v1/goodsPrice/setGoodsPrice?goodsId=' + data.goodsId,
    data
  );
}
//查询门店商品价格
export function queryGoodsStorePrices(data) {
  return post(
    '/api/goods-service/v1/goodsPrice/queryGoodsStorePricesPage',
    data
  );
}

//编辑门店商品价格
export function modifyStorePrice(data) {
  return patchJson(
    '/api/goods-service/v1/goodsPrice/setStorePrice?goodsId=' + data.goodsId,
    data
  );
}

//新增商品单位
export function createGoodsUnit(data) {
  return post('/api/goods-service/v1/goods/createGoodsUnit', data);
}
//编辑商品单位
export function updateGoodsUnit(data) {
  return put('/api/goods-service/v1/goods/updateGoodsUnit', data);
}
//删除 商品单位
export function deleteGoodsUnit(data) {
  return dalete('/api/goods-service/v1/goods/deleteGoodsUnit', data);
}

//新增商品品牌
export function createGoodsBrand(data) {
  return post('/api/goods-service/v1/goods/createGoodsBrand', data);
}
//编辑商品品牌
export function modifyGoodsBrand(data) {
  return put('/api/goods-service/v1/goods/updateGoodsBrand', data);
}
//删除 商品品牌
export function deleteGoodsBrand(data) {
  return dalete('/api/goods-service/v1/goods/deleteGoodsBrand', data);
}

//商城商品目录查询
export function queryMallGoods(data) {
  return post('/api/goods-service/v1/onlineMall/queryMallGoods', data);
}

//全部上架
export function allSelcect(data) {
  return get('/api//goods-service/v1/onlineMall/allOnShelf', data);
}
//上架
export function productUp(data) {
  return post('/api/goods-service/v1/onlineMall/onShelf', data);
}
//下架
export function productDown(data) {
  return daleteJson('/api/goods-service/v1/onlineMall/offShelf', data);
}

//查询门店商品列表/api/goods-service/v1/        goodsPrice/queryStockGoods
export function queryStockGoods(data) {
  return post('/api/goods-service/v1/goodsPrice/queryStockGoods', data);
}

//商品价签查询
export function queryGoodsStorePriceTags(data) {
  return post(
    '/api/goods-service/v1/goodsPrice/queryGoodsStorePriceTags',
    data
  );
}

//更新商品价签
export function setGoodsStorePriceTags(data, orgSeq) {
  return post(
    '/api/goods-service/v1/goodsPrice/setGoodsStorePriceTags?isPriceTag=1&storeId=' +
      orgSeq,
    data
  );
}

//商品价签查询
export function cutGoodsInfo(data) {
  return post('/api/goods-service/v1/goods/cutGoodsInfo', data);
}
